# Contributor: Ivan Tham <pickfire@riseup.net>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=libwacom
pkgver=2.9.0
pkgrel=0
pkgdesc="Library to help implement Wacom tablet settings"
url="https://github.com/linuxwacom/libwacom/wiki"
arch="all"
license="MIT"
depends="eudev"
makedepends="
	glib-dev
	libevdev-dev
	libgudev-dev
	meson
	py3-libevdev
	py3-pytest
	py3-udev
	"
checkdepends="bash findutils diffutils libxml2-dev"
subpackages="$pkgname-dev $pkgname-doc"
install="$pkgname.post-install $pkgname.post-upgrade"
source="https://github.com/linuxwacom/libwacom/archive/libwacom-$pkgver/libwacom-$pkgver.tar.gz
	0001-udevadm.patch
	"
builddir="$srcdir/libwacom-libwacom-$pkgver"

build() {
	abuild-meson \
		-Dtests="$(options_has !check && echo disabled || echo enabled)" \
		-Dudev-dir="/lib/udev" \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
35e1f9027a894faf0b35b027ff4e300c29f3d296813938c6a0719641e096ea3df6bf52003d46817bcdd2197d6ac9b9d5b25030e0f7c0116abe24008e7a89f28d  libwacom-2.9.0.tar.gz
f1dd2376782584a71e84fedb83f6c3633e8b27977c6f65b3dc9db20dd0c8b761df44645d40049aef005f6ee6d7ce7496f5971306b9af778c36e59a4823235869  0001-udevadm.patch
"
